
<template>
<SidebarLeft/>
        <div class="container">
            <!-- 菜单栏 -->
            <div class="main-content" :class="{expanded: isexpanded}">
                <div class="new-uploads">
                    <div class="Heading">
                        <h1>教学</h1>
                        <router-link to="/教学">>>更多</router-link>
                    </div>
                    <div class="video list-item">
                        <a
                            class="item"
                            v-for="(upload, index) in newUploads"
                            :key="index"
                            style="display: flex; flex-direction: column; height: 150px; width: 180px; background-color: rgba(255, 255, 255, 0);
                            border: none;"
                            >
                            <a :href="upload.link" style="display:flex; flex-direction:column;">
                                <video :src="upload.video" :alt="upload.title" style="width:180px; height:100px; border-radius:5px;">
                                </video>
                                <p>{{ upload.title }}</p>
                            </a>
                        </a>
                    </div>
                </div>
                <div class="immersive experience">
                    <div class="Heading">
                        <h1>沉浸式体验</h1>
                        <a href="./experience.html">>>更多</a>
                    </div>
                    <div class="immersive list-item">
                        <a href="">
                            <video src="/videos/阿婆茶.mp4" height="100px" width="180px" controls></video>
                            <p>太极推手</p>
                        </a>
                        <a href="">剪纸</a>
                        <a href="">锻造</a>
                    </div>
                </div>
                <div class="new-uploads">
                    <div class="Heading">
                        <h1>消息</h1>
                        <a href="./news.html">>>更多</a>
                    </div>
                    <a class="news list-item" v-for="(item,index) in news" :key="index"
                    style="color: white" :href="item.link">
                        <img :src="item.image" :alt="item.title" height="100px" width="180px">
                        <div>
                            <h3>{{ item.title }}</h3>
                            <p>{{ item.describtion }}</p>
                        </div>
                    </a>
                </div> 
            </div>
            <SidebarRight/>   
        </div>
</template>

<script>
export default {
    name: 'HomePage',
    data() {
        return {
        // 模拟新上传的数据
        newUploads: [
            { title: "制陶", link: "#", video: "/videos/makepottery.mp4" },
            { title: "太极新教学", link: "#", video: "images/new/taichi.mp4" },
            { title: "传统音乐演奏", link: "#", video: "images/new/music.mp4" }
        ],
        news: [
            { title: "关于太极如何圆裆",link: "#", image: require("@/assets/loginpage/太极.png"), describtion:"欲行此拳，必先圆裆。" }],
        isexpanded: false, // 控制是否展开
    }
}
}
</script>

<style scoped>
.container{
    display: flex;
    width: 100vw;
    height: 100vh;
    position: relative;
    z-index: 0;
}
.main-content{
    display: flex;
    width: calc(100% - 600px);
    height: 100%;
    flex-direction: column;
    margin-left: 150px;
    margin-top: 60px;
    overflow-y: auto;
}
.new-uploads{
    width: 100%;
    height: auto;
}
.Heading{
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
}
.video.list-item {
  display: flex;
  flex-direction: row;
  gap: 50px;
  height: 200px;
  overflow: hidden;
  background-color: rgba(255, 255, 255, 0);
}
.immersive.list-item{
    display: flex;
    flex-direction: row;
    height: 200px;
    width: 100%;
}
.immersive.list-item a{
   display: flex;
   flex-direction: column;
   width: 100%;
   height: 100%;
}
.news.list-item{
   display: flex;
   flex-direction: row; 
}
</style>
    
